<template>
  <div>
    <span> props传值 父组件的值count: {{count}} </span>
    <child :count="count"  :changeCount="changeCount" />
    <!-- 
      如果是传值 是父传子
      如果是函数 是子传父
     -->
  </div>
</template>

<script>
import Child from './Child.vue'
export default {
  components: { Child },
  data() {
    return {
      count:0
    }
  },
  methods: {
    changeCount(n){
      this.count += n
    }
  },

}
</script>
<style scoped>
div{
  color:rgb(203, 230, 188);
}
</style>